gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp)) +geom_point()
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp)) +geom_point() +labs(x ="GDP per capita", y ="Life expectancy", title ="Life expectancy versus GDP in 2007")
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp)) +geom_point() +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in 2007")
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp, size = pop)) +geom_point() +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in 2007")
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp, size = pop)) +geom_point(alpha =0.5) +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in 2007")
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp, size = pop)) +geom_point(alpha =0.5) +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in 2007") +theme_bw()
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp, size = pop)) +geom_point(alpha =0.5) +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in 2007") +theme_bw() +facet_wrap(~ continent)
gapminder |>filter(year ==2007) |>ggplot(aes(x = gdpPercap, y = lifeExp, size = pop, color = continent)) +geom_point(alpha =0.5) +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in 2007") +theme_bw() +facet_wrap(~ continent)
gapminder |>ggplot(aes(x = gdpPercap, y = lifeExp, size = pop, color = continent)) +geom_point(alpha =0.5) +scale_x_log10() +labs(x ="GDP per capita", y ="Life expectancy",title ="Life expectancy versus GDP in {frame_time}") +theme_bw() +facet_wrap(~ continent) +transition_time(year)